﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace FinalPointSet.Model.Asset
{
    public static class JsonAssetLoader
    {
        public static T? GetObject<T>(string path, JsonConverter? convert = null)
        {
            return AssetUtil.LoadJsonAsObject<T>(path, convert);
        }
        public static List<T>? GetObjects<T>(string path, JsonConverter? convert = null)
        {
            return AssetUtil.LoadJsonAsObjects<T>(path, convert);
        }
        public static void SaveObject<T>(T obj, string path, JsonConverter? convert = null)
        {
            AssetUtil.SaveObjectAsJson(obj, path, convert);
        }
        public static void SaveObjects<T>(List<T> objs, string path, JsonConverter? convert = null)
        {
            AssetUtil.SaveObjectsAsJson(objs, path, convert);
        }
    }
}
